﻿using T0yK4T.Tools;
using System.Net;
using T0yK4T.Configuration;
using System.ComponentModel;

namespace ToyChat.Server
{
    /// <summary>
    /// Interface for server settings
    /// </summary>
    public interface IServerSettings : IValidatable
    {
        /// <summary>
        /// Gets or Sets the name of the server
        /// </summary>
        string ServerName { get; set; }

        /// <summary>
        /// Gets or Sets the local endpoint to bind the listening socket to
        /// </summary>
        IPEndPoint LocalEndpoint { get; set; }

        /// <summary>
        /// Gets or Sets the database server's hostname / ip address
        /// </summary>
        string DatabaseHost { get; set; }

        /// <summary>
        /// Gets or Sets the database name
        /// </summary>
        string DatabaseName { get; set; }

        /// <summary>
        /// Gets or Sets the username to use when connecting to the database
        /// </summary>
        string DatabaseUser { get; set; }

        /// <summary>
        /// Gets or Sets the password to use when connecting to the database (This is not secure!)
        /// </summary>
        string DatabasePass { get; set; }

        /// <summary>
        /// Gets or Sets the port to connect to when connecting to the database server
        /// </summary>
        int DatabasePort { get; set; }

        /// <summary>
        /// Gets or Sets a value indicating whether or not this server requires a user account / login to connect to.
        /// </summary>
        bool RequireLogin { get; set; }

        /// <summary>
        /// Gets or Sets a value indicating wether or not the server will allow the database handler to be switched out
        /// </summary>
        bool AllowDBSwitch { get; set; }

        /// <summary>
        /// This event is fired whenever a settings property has changed
        /// </summary>
        event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
    }
}